import 'package:flutter/material.dart';
import 'package:flutter_eve_plugin/constants/font_family.dart';
import 'package:flutter_eve_plugin/constants/font_weight.dart';
import 'package:flutter_eve_plugin/model/ye_xiu/achieves/archieves_weapon_entity.dart';
import 'package:flutter_eve_plugin/utils/screen_util.dart';

class ArchivesUpgradeTopWidget extends StatelessWidget {
  final ArchievesWeaponEntity weaponEntity;
  const ArchivesUpgradeTopWidget({
    Key key,this.weaponEntity
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      height: setRatio(260),
      child: Center(
        child: Stack(
          children: <Widget>[
            Container(
              width: setRatio(150),
              height: setRatio(156),
              decoration: BoxDecoration(
                  borderRadius: BorderRadius.circular(setRatio(10)),
                  image: DecorationImage(
                      fit: BoxFit.fill,
                      image: NetworkImage(
                          '${weaponEntity?.currentForm?.picUrl ?? ''}'))),
            ),
            Positioned(
              bottom: 0,
              child: Container(
                width: setRatio(150),
                height: setRatio(16),
                decoration: BoxDecoration(
                    color: Color(0xFFFCAB2C),
                    borderRadius: BorderRadius.only(
                        bottomLeft: Radius.circular(setRatio(10)),
                        bottomRight: Radius.circular(setRatio(10)))),
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.start,
                  crossAxisAlignment: CrossAxisAlignment.center,
                  children: <Widget>[
                    SizedBox(
                      width: setRatio(6),
                    ),
                    Text(
                      '千机伞',
                      style: TextStyle(
                          color: Color(0xFFFFFFFF),
                          fontFamily: FontFamily.PINGFANG,
                          fontWeight: FontWeightCustom.PF_Medium,
                          fontSize: setTextSp(9)),
                    ),
                    Expanded(
                      child: Container(),
                    ),
                    Text(
                      '${weaponEntity?.weaponLevel ?? 0}',
                      style: TextStyle(
                          color: Color(0xFFFFFFFF),
                          fontFamily: FontFamily.PMZD,
                          fontSize: setTextSp(10)),
                    ),
                    SizedBox(
                      width: setRatio(6),
                    ),
                  ],
                ),
              ),
            )
          ],
        ),
      ),
    );
  }
}
